<template>
    <div>
      <div id="top">
      <div id="topBar">
        <router-link :to="{path:'/exchangePoints/detail'}"><van-icon name="arrow-left" style="float: left;margin-top: 0.5rem;margin-left: 0.5rem"/>
          <p style="float: left">兑换</p></router-link>
      </div>
      </div>
      <div id="mid">
      <div id="box">
        <p id="name">商品：{{name}}</p>
        <div id="pic" :style="{backgroundImage: 'url(' + pic + ')', backgroundRepeat:'no-repeat', backgroundSize: 'cover',backgroundPosition:'center center'}">

        </div>
        <p id="price">
        {{price}}
        </p>
        <p id="num">
          x{{num}}
        </p>
      </div>
      </div>
      <div id="foot">
        <div>确认</div>
        <p style="font-size: 1.5rem;color: white;font-weight: bold">{{price}}</p>
        <p style="font-size: 0.8rem;">合计</p>
      </div>
    </div>
</template>

<script>
    export default {
        name: "exchange",
      data(){
          return{
            name:"巨大无敌汽车",
            price:"23992849872",
            num:"1",
            pic:"https://img.yzcdn.cn/vant/apple-1.jpg"
          }
      }
    }
</script>

<style scoped>
  #top{
    width: 100%;
    height:4rem;
    background: red;
    overflow: hidden;
    position: relative;
  }
  #topBar{
    height: 2rem;
    width: 100%;
    line-height: 2rem;
    background: papayawhip;
    color:black;
    font-size: 1rem;
    margin-top: 1rem;
  }
  #topBar p{
    display: inline-block;
  }
 #mid{
   height: 9rem;
   width: 100%;
   padding: 1rem 1rem;
   box-sizing: border-box;
 }
#box{
  height: 100%;
  width: 100%;
  border: 0.1rem dotted #39a9ed;
  padding: 0.1rem 0.5rem;
  box-sizing: border-box;
  position: relative;
}

  #name{
    font-size: 0.8rem;
    float: left;
    margin-left: 1rem;
  }
  #pic{
    height: 4rem;
    width: 6rem;
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
  }
  #price{
    position: absolute;
    right: 0.5rem;
    top: 48%;
    font-size: 0.8rem;
  }
  #num{
    position: absolute;
    left: 48%;
    bottom: 0.5rem;
    font-size: 0.8rem;
  }
  #foot{
    height: 3.5rem;
    background: #98d6f4;
    position: absolute;
    bottom: 0;
    width: 100%;
  }
  #foot p{
    float: right;
    height: 100%;
    line-height: 3.5rem;
    margin-right: 1rem
  }
  #foot div{
    height: 1.8rem;
    width: 4.5rem;
    background: #39a9ed;
    border-radius: 0.1rem;
    font-size: 0.8rem;
    color: white;
   line-height: 1.8rem;
    box-sizing: border-box;
    float: right;
    margin-top: 0.8rem;
    margin-right: 1rem;
  }
</style>
